package com.example.eureka_client.service.impl;

import com.example.eureka_client.entity.AttentionQuestion;
import com.example.eureka_client.mapper.AttentionQuestionMapper;
import com.example.eureka_client.service.IAttentionQuestionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 用户关注问题关联表 服务实现类
 * </p>
 *
 * @author plj
 * @since 2022-04-17
 */
@Service
public class AttentionQuestionServiceImpl extends ServiceImpl<AttentionQuestionMapper, AttentionQuestion> implements IAttentionQuestionService {
    @Override
    public List<String> getAllQuestionId(String userId){
        List<AttentionQuestion> attentionQuestions = baseMapper.getAllQuestionId(userId);
        List<String> questionIds = new ArrayList<>();
        for(AttentionQuestion attentionQuestion: attentionQuestions) questionIds.add(attentionQuestion.getQuestionId());

        return questionIds;
    }
}
